from tutor.scripts import *
from tutor.plugins.sympy import *

with display_block('Entradas'):
    # seleciona pontos
    g, k = oneof((cos, 2),
                 (cos, 4),
                 (sin, 1),
                 (exp, pi),
                 (exp, -pi))
    G = Lambda(x, g(x).integrate())
    a = oneof(2,3,4,5,6,9)
    b = sqrt(a)
    func = g(pi/k * x/(a - y**2))/a
    lim_sup = sqrt(a - x)
    lim_sup_x = a - y**2
    lim_sup_subs = sqrt(a - y)

with display_block('Respostas'):
    correta = Two/3 * sqrt(a)/pi * k * (G(pi/k) - G(0))
    dis_1 = correta * sqrt(a)
    dis_2 = correta * 3 / 2
    dis_3 = correta * sqrt(a) * 3 / 2
    dis_4 = Two/3 * sqrt(a)/pi * k * G(pi/k)
    dis_5 = dis_4 * sqrt(a)
    dis_6 = dis_4 * 3 / 2
    dis_7 = dis_4 * sqrt(a) * 3 / 2